Accusoft.ImagXpress13.Net
Save Image to Stream

Prior to saving an image, set the SaveOptions to provide specific instructions for saving the image. If no save options are specified, ImagXpress® uses default values when saving the image.

Save to Stream

To save an image to a memory or file stream, call ImageX.SaveStream. The ImageStatusEvent and ProgressEvent events are raised to provide feedback on the status of the saving process. 

To save to a BLOB (Binary Large Object), use the ImageX.SaveStream method.
To save a file to an Internet stream, use the ImageX.Save method, specifying the full Internet path and file name, NOT the SaveStream method. 

To save an ImageX image to stream:

  1. Create a stream object, derived from the System.IO.Stream
  2. Call the ImageX.SaveStream method.  
C# Example
Copy Code
// This code demonstrates saving an image to a stream

using System.IO;
using Accusoft.ImagXpressSdk;
using (MemoryStream stream = new MemoryStream())
{
// Initialize the ImagXpress workspace component
using (ImagXpress imagXpress1 = new ImagXpress())
{
using (ImageX image = ImageX.FromFile(imagXpress1, "C:\\images\\somefile.tif"))
{
//Set up the SaveOptions
SaveOptions saveOptions = new SaveOptions();
saveOptions.Format = ImageXFormat.Tiff;
saveOptions.Tiff.Compression = Compression.Group4;
image.SaveStream(stream, saveOptions);
}
} 

 

See Also

 

 


©2019. Accusoft Corporation. All Rights Reserved.

Send Feedback